#ifndef __VTOR_PID_H__
#define	__VTOR_PID_H__

#ifdef __cplusplus
extern "C" {
#endif

#include "vtor_elec_module_config.h"

#ifdef __VTOR_PID__

typedef struct
{
	float cur;
	float exp;
	
	float err;
	float kerr;
	float lastErr;
	float totalErr;
	
	float kp;
	float ki;
	float kd;
	
	float lastTime;
	float intervalTime;

	float outp;
	float outi;
	float outiMax;
	float outiMin;
	float outd;
	float out;
	float outMax;
	float outMin;
}VtorPid;





void VtorPid_Init(void);
void VtorPid_Clear(VtorPid* pid);
void VtorPid_Calc(VtorPid* pid, float curTime);
void VtorPid_SetExp(VtorPid* pid, float exp);
void VtorPid_SetCur(VtorPid* pid, float cur);

#endif // __VTOR_PID__

#ifdef __cplusplus
}
#endif

#endif
